https://glot.io/snippets/giviyza7hq/raw/main.lua